import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.util.Properties;
import java.io.InputStream;

public class DateBaseUtil{

	private static Connection conn = null;

	static {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			InputStream is = DateBaseUtil.class.getClassLoader().getResourceAsStream("resources/jdbc.properties");
			Properties pro = new Properties();
			pro.load(is);
			String url = pro.getProperty("jdbc.url");
			String username = pro.getProperty("jdbc.user");
			String pwd = pro.getProperty("jdbc.pwd");
			conn = DriverManager.getConnection(url, username, pwd);
			System.out.println("connection success");
		} catch(Exception e) {
			e.printStackTrace();
		}

		
	}

	public static Connection getConn() {
		return conn;
	}
}